<template>
	<div>
		首页
	</div>
</template>

<script>
	import {login,getCode} from '~/api/login'
	
	export default {
		data() {
			return {}
		},
		async asyncData({req,res,app,$axios}) {
			// 请检查您是否在服务器端
			// 使用 req 和 res
			login($axios, {
				phone: 2,
				type: 1
			})
			
			
			if (process.server) {
				//console.log(req.headers.cookie)
				return {
					host: req.headers.host
				}
			} else {
				//console.log(app.$cookies.get('theme'))
			}
			return {}
		},
		created() {
			if (!process.server) {
				// this.$axios.post('/api/captcha',{
				//   phone:2,
				//   type:1
				// }).then(res=>{
				// 	
				// })
				//this.$cookies.set('theme2','default');
				//console.log(this.$cookies.get('theme'))
			}
		}
	}
</script>

<style>
</style>
